package com.example.footballsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.footballsystem.entity.Game;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GameMapper extends BaseMapper<Game> {

    @Select("select *  from game")
    public List<Game> getAllGame();
    @Select("select * from game where seriesID=#{seriesID}")
    public List<Game> getGameBySeriseID(int seriesID);
    @Insert("insert into game (seriesID, time, session, createdate) VALUES (#{seriesID},#{time},#{session},#{createDate})")
    public Boolean addGame(Game game);
    @Delete("delete from game where seriesID=#{seriesID} && session=#{session}")
    public Boolean deleteGame(int seriesID,int session);
}
